//
//  AiChatBean.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/2/27.
//

import Foundation
class AiChatBean : Codable {
    var aiVoiceSpeed: Double = 1.0 // 默认语速
    var groupId: String? = nil
    var token: String? = nil //minmax token
    var functionAiModel: [String : Int]? = nil//ai模型  //0为minmax 1为豆包，2为rtsagi  只针对日记，评论、来电、ai日记、来信（后续扩展图片理解，经期）
    var aiReplyProhibit: [String]? = nil//ai回复违禁词
    var aiVoiceTestStr: String? = nil//语音试听内容
    var aiHint2: String? = nil//ai模版
    var aiHintChat:String? = nil //聊天回复规则
    var aiRoleMaxLength: Int? = nil//人设数量
    var aiMonthVipCount: Int? = nil//每月赠送次数
    var aiMonthCount: Int? = nil//每月赠送次数
    var aiDayVipCount: Int? = nil//每日赠送次数
    var aiDayCount: Int? = nil//每日赠送次数
    var diaryCommentCount: Int? = nil //日记评论数量
    var aiVoiceClonePrice: String? = nil
    var bubbleActSign: String? = nil//气泡活动标识
    var aiActSign: String? = nil//AI活动赠送标识
    var aiActCount: Int = 0//AI活动赠送次数
    var aiActVipCount: Int = 0//AI活动赠送次数
    var aiMemoryCount: Int = 1 // 注入后，每次回应次数消耗
    var aiMemoryInjectCount: Int = 50 // 注入数量
    var inviteCount: Float? = nil
    
    func getAiModel(aiMode: IAiModelType) -> Int {
        let userMapAiModel = userManager.getExtraConfig().functionAiModel
        let hasKey = userMapAiModel?.contains { key, _ in
            key == aiMode.rawValue
        }
        if (hasKey == true) {
            return userMapAiModel?[aiMode.rawValue] ?? 0
        }
        return functionAiModel?[aiMode.rawValue] ?? 0
    }
}
